<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Welcome to Nozama Book Store</title>
</head>
<sql:setDataSource driver="com.mysql.jdbc.Driver" 
	url="jdbc:mysql://localhost:3306/bookstore"
	user="bkadmin"
	password="nozama"/>

<body>
	<sql:query var="categories" sql="SELECT * FROM CATEGORIES">
	</sql:query>
	<h2>Welcome to Nozama BookStores!</h2>
	<p> Please choose from the following categories: </p>
	<ul>
	<c:forEach var="row" items="${categories.rows}">
	<li>
	<a href="books?catName=${row.category_name}&catId=${row.category_id}">
		<c:out value="${row.category_name}"></c:out>
	</a>
	</li> 
	</c:forEach>
	</ul>
</body>
</html>